<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //父构造函数
    function Person(name, age) {
      this.name = name
      this.age = age
    }

    //子构造函数
    function Teacher(name, age, coures) {
      //改变Person的this指向，实现给Teacher属性赋值，从而实现属性继承
      Person.call(this, name, age)
      this.coures = coures
    }

    const zp = new Teacher('zp', 18, '前端')
    console.log(zp)
  </script>
</body>

</html>